<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      function fn() {
        num2 = 20;
      }
      fn();
      console.log(num2);	// 输出结果：20
    </script>
  </body>
</html>